Skip to content

Conversation

@lukeredpath
Copy link

Adds the ability to disable the current default behaviour of triggering a test failure whenever reportIssue is called in a testing context with a new flag TestContext.emitsFailureOnReportIssue. This value can be overridden for a single operation using the withEmitsFailureOnReportIssue(_) helper function.

Resolves #145.

@adamjcampbell
Copy link

Awesome work, this is needed! I wonder if it'd be better if this behaviour was part of the existing IssueReporters array so that the existing method to disable things via:

withIssueReporters([]) {
  // Reported issues will be ignored here...
}

Would work as per the documentation

This would mean in a testing context IssueReporters.current should return an array including a TestReporter

@stephencelis
Copy link
Member

Sorry for leaving this hanging Luke! We're definitely down for the functionality but as @adamjcampbell mentioned it would be nice for it to be seamlessly integrated into existing APIs. We'll try to get around to thinking more about this soon.

stephencelis added a commit that referenced this pull request Nov 14, 2025
This patch moves the test reporting logic into a `default` reporter so
that changing the reporters can influence tests.

This is an alternate solution to #146.
@stephencelis
Copy link
Member

@lukeredpath Thanks again for starting the discussion on this. I've pushed a PR for a more integrated solution here: #174

Going to close this out but glad you opened it to get things moving (albeit slowly!) 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot disable test failure behaviour

3 participants